//
//  InspirationCell.m
//  NewNest
//
//  Created by hesiyao on 16/1/23.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "InspirationCell.h"

@implementation InspirationCell

-(void)dealloc
{
    [_titleLabel release];
    [_contentLabel release];
    [_imgView release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.titleLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_titleLabel];
        [_titleLabel release];
        
        self.imgView = [[UIImageView alloc] init];
        [self.contentView addSubview:_imgView];
        [_imgView release];
        
        self.contentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_contentLabel];
        [_contentLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imgView.frame = CGRectMake(5, 5, self.contentView.frame.size.height - 10, self.contentView.frame.size.height - 10);
    _imgView.backgroundColor = [UIColor redColor];
    self.titleLabel.frame = CGRectMake(10 + _imgView.frame.size.width, 5, self.contentView.frame.size.width - 10 - _imgView.frame.size.width, self.contentView.frame.size.height / 5);
//    _titleLabel.backgroundColor = [UIColor yellowColor];
    
    self.contentLabel.frame = CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.origin.y + _titleLabel.frame.size.height + 5, self.contentView.frame.size.width - _imgView.frame.size.width - 10, self.contentView.frame.size.height - _titleLabel.frame.size.height - 15);
    _contentLabel.numberOfLines = 0;
    _contentLabel.font = [UIFont systemFontOfSize:14];
    _contentLabel.textColor = [UIColor grayColor];
//    _contentLabel.backgroundColor = [UIColor cyanColor];
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
